package book;

public class BookList {
    private Book[] books = new Book[10];//我们用数组来代替书架
    private int usedSize;//记录当前书架上有几本书
    public BookList() {
        books[0] = new Book("三国演义","罗贯中",28,"名著");
        books[1] = new Book("水浒传","施耐庵",19,"名著");
        books[2] = new Book("西游记","吴承恩",8,"名著");
        this.usedSize = 3;
        //我们默认书架上有3本书
    }

    public Book getBook(int pos) {
        return books[pos];
    }
    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public void setBooks(int pos,Book book) {
        books[pos] = book;
    }

}
